import serial

def sendSTOP():
    ser = serial.Serial('COM3', 115200, timeout=0.1)
    ser.write(b'STOP')
    ser.close()

import time
#time format
def time_(t):
    return time.strftime("%H:%M:%S", time.localtime(t))
while True:
    print(time_(time.time()))
    # sendSTOP()
    # input = input("Press enter to send STOP signal: ")
    #sendSTOP()